<?php

namespace app\common\model\pachong;

use app\common\model\BaseModel;
use app\common\model\RedisService;
use app\common\model\Tool;
use think\Model;

class PachongProxyIp extends BaseModel
{
    // 设置当前模型对应的完整数据表名称
    protected $table='ea8_pachong_proxy_ip';

    private $redisKey = "ProxyIp";

    // curl -v -H "Proxy-Authorization: Basic MTgyMDI3NzAwNzI6elZkTEZ5Vm4=" "https://www.tianqishi.com/fuchuan/20211104.html" -x 183.153.85.115:39781
    public function getProxyIp(): String
    {
        // 查看缓存里面是不是有
        $ip = RedisService::instance()->get($this->redisKey);
        if(empty($ip)){
            //$obj = self::find(1)->toArray();
            //$ip = Tool::getCurl($obj['url'],false);
            //RedisService::instance()->set($this->redisKey,$ip, $obj['keep_time']);
        }
        return $ip;
    }

}
